﻿IF EXISTS (SELECT * from sys.procedures p left join sys.schemas s on p.schema_id = s.schema_id where p.name='account_update' and s.name='Crm')
DROP PROCEDURE [Crm].account_update
GO
CREATE PROCEDURE [Crm].account_update 
@PK uniqueidentifier, 
@CategoryID uniqueidentifier, 
@Name nvarchar(200), 
@Address nvarchar(500), 
@ZipCode nvarchar(5), 
@City nvarchar(100), 
@Country nvarchar(100), 
@Url nvarchar(100), 
@Comment nvarchar(4000)
AS
BEGIN
UPDATE [Crm].[Accounts] 
SET	[id_category] = @CategoryID ,
	[name] = @Name ,
	[address] = @Address ,
	[zip_code] = @ZipCode ,
	[city] = @City ,
	[country] = @Country ,
	[url] = @Url ,
	[comment] = @Comment 
WHERE
	[id_account] = @PK 
END